package com.group9.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttribute;

import javax.servlet.http.HttpSession;
import javax.websocket.server.PathParam;

/**
 * Created by Lcouncillor on 2020/6/3.
 */
@Controller
@RequestMapping(value = "addsession")
public class AddSessionUserId {

    @RequestMapping(value = "/{userId}")
    @ResponseBody
    public String AddSession(HttpSession session, @PathParam("userId") Integer userId){
        session.setAttribute("userId",userId);
        return userId+"登陆成功";
    }
}
